package cn.wolfcode.service;

import cn.wolfcode.domain.OperateIntergralVo;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;


@LocalTCC      //代表此接口类至此TCC事务
public interface IUsableIntegralService {
     Boolean alipayOnIntergral(OperateIntergralVo vo);
    @TwoPhaseBusinessAction(
            name = "alipayOnIntegralTry",
            commitMethod = "refundOnIntegralConfirm",
            rollbackMethod ="refundOnIntegralCancel")
   // @BusinessActionContextParameter(paramName = "vo") OperateIntegralVo vo  将vo对象放到上下文中
    Boolean refundOnIntegralTry(@BusinessActionContextParameter(paramName = "vo") OperateIntergralVo vo,
                                 BusinessActionContext context);

    Boolean refundOnIntegralConfirm(BusinessActionContext context);

    Boolean refundOnIntegralCancel(BusinessActionContext context);
}
